<template>
  <div>

    <el-row>
      <el-col :span="24">
        <div class="grid-content bg-purple-dark">
          <h2>商品信息详情</h2>
        </div>
      </el-col>
    </el-row>

    <el-card class="box-card">
      <el-row>
        <el-col :span="5" class="labClass">
          <div class="grid-content bg-purple">
            <span>商品图片:</span>
          </div>
        </el-col>
        <el-col :span="16">
          <div class="block">
            <el-image :src="imgSrc"></el-image>
          </div>
        </el-col>
        <el-col :span="3" class="labClass">
          <div class="grid-content bg-purple">
          </div>
        </el-col>
      </el-row>
      <p/>
      <br>
      <p/>
      <el-row>
        <el-col :span="5" class="labClass">
          <div class="grid-content bg-purple">
            <span>商品编号:</span>
          </div>
        </el-col>
        <el-col :span="16">
          <div class="grid-content bg-purple-light">
            <span>{{ productNumber }}</span>
          </div>
        </el-col>
        <el-col :span="3" class="labClass">
          <div class="grid-content bg-purple">
          </div>
        </el-col>
      </el-row>
      <p/>
      <br>
      <p/>
      <el-row>
        <el-col :span="5" class="labClass">
          <div class="grid-content bg-purple">
            <span>商品名称:</span>
          </div>
        </el-col>
        <el-col :span="16">
          <div class="grid-content bg-purple-light">
            <span>{{ productName }}</span>
          </div>
        </el-col>
        <el-col :span="3" class="labClass">
          <div class="grid-content bg-purple">
          </div>
        </el-col>
      </el-row>
      <p/>
      <br>
      <p/>
      <el-row>
        <el-col :span="5" class="labClass">
          <div class="grid-content bg-purple">
            <span>厂家:</span>
          </div>
        </el-col>
        <el-col :span="16">
          <div class="grid-content bg-purple-light">
            <span>{{ productFirm }}</span>
          </div>
        </el-col>
        <el-col :span="3" class="labClass">
          <div class="grid-content bg-purple">
          </div>
        </el-col>
      </el-row>
      <p/>
      <br>
      <p/>
      <el-row>
        <el-col :span="5" class="labClass">
          <div class="grid-content bg-purple">
            <span>类别:</span>
          </div>
        </el-col>
        <el-col :span="16">
          <div class="grid-content bg-purple-light">
            <span>{{ productClass }}</span>
          </div>
        </el-col>
        <el-col :span="3" class="labClass">
          <div class="grid-content bg-purple">
          </div>
        </el-col>
      </el-row>
      <p/>
      <br>
      <p/>
      <el-row>
        <el-col :span="5" class="labClass">
          <div class="grid-content bg-purple">
            <span>建议采购价:</span>
          </div>
        </el-col>
        <el-col :span="16">
          <div class="grid-content bg-purple-light">
            <span>{{ productBuyer }}</span>
          </div>
        </el-col>
        <el-col :span="3" class="labClass">
          <div class="grid-content bg-purple">
          </div>
        </el-col>
      </el-row>
      <p/>
      <br>
      <p/>
      <el-row>
        <el-col :span="5" class="labClass">
          <div class="grid-content bg-purple">
            <span>库存数量:</span>
          </div>
        </el-col>
        <el-col :span="16">
          <div class="grid-content bg-purple-light">
            <span>{{ stockNumber }}</span>
          </div>
        </el-col>
        <el-col :span="3" class="labClass">
          <div class="grid-content bg-purple">
          </div>
        </el-col>
      </el-row>
      <p/>
      <br>
      <p/>
      <el-row>
        <el-col :span="5" class="labClass">
          <div class="grid-content bg-purple">
            <span>建议销售价:</span>
          </div>
        </el-col>
        <el-col :span="16">
          <div class="grid-content bg-purple-light">
            <span>{{ productSell }}</span>
          </div>
        </el-col>
        <el-col :span="3" class="labClass">
          <div class="grid-content bg-purple">
          </div>
        </el-col>
      </el-row>
      <p/>

      <el-button type="success" @click="returns">返回</el-button>
    </el-card>

  </div>
</template>

<script>
export default {
  name: "findByProductId",
  data(){
    return{
      stock:'',

      productNumber:'',
      productName:'',
      productFirm:'',
      productClass:'',
      productBuyer:'',
      stockNumber:'',
      productSell:'',
      imgSrc:''
    }
  },
  methods: {
    init(stock) {
      console.log('drp/img/'+stock.productBean.imgPath)
      this.stock = stock;
      this.productNumber=stock.productBean.number
      this.productName=stock.productBean.productName
      this.productFirm=stock.productBean.productFirm
      this.productClass=stock.productBean.productClass
      this.productBuyer=stock.productBean.productBuyer
      this.stockNumber=stock.number
      this.productSell=stock.productBean.productSell
      this.imgSrc='drp/img/'+stock.productBean.productImgPath
    },
    returns() {
      location.href = "/index"
    }
  }
}
</script>

<style scoped>

</style>